package com.google.mr.okhttptest.utils;

import android.app.Activity;

import com.google.mr.okhttptest.BaseActivity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/11/24.
 */

public class ActivityManagerUtils {
    private static List<BaseActivity> mList = new ArrayList<BaseActivity>();

    public static void addActivity(BaseActivity activity){
        mList.add(activity);
    }

    public static void removeActivity(BaseActivity activity){
        mList.remove(activity);
    }
    
    public void finishAll(){
        for (BaseActivity activity :
                mList) {
            if (!activity.isFinishing()) {
                activity.finish();
            }
        }
    }
}
